﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true" CodeBehind="ThongKeDoanhThu.aspx.cs" Inherits="CungMuaC5.Account_Admin.ThongKeDoanhThu" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

 <script src="js/jquery-1.4.3.min.js" type="text/javascript"></script>
    <style type="text/css">
        .web_dialog_overlay
        {
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            height: 100%;
            width: 100%;
            margin: 0;
            padding: 0;
            background: #000000;
            opacity: .15;
            filter: alpha(opacity=15);
            -moz-opacity: .15;
            z-index: 101;
            display: none;
        }
        .web_dialog
        {
            display: none;
            position: fixed;
            width: 550px;
            height: 400px;
            top: 50%;
            left: 50%;
            margin-left: -190px;
            margin-top: -100px;
            background-color: #ffffff;
            border: 2px solid #336699;
            padding: 0px;
            z-index: 102;
            font-family: Verdana;
            font-size: 10pt;
        }
        .web_dialog_title
        {
            border-bottom: solid 2px #336699;
            background-color: #336699;
            padding: 4px;
            color: White;
            font-weight:bold;
        }
        .web_dialog_title a
        {
            color: White;
            text-decoration: none;
        }
        .align_right
        {
            text-align: right;
        }
    </style>
    <script type="text/javascript">

        $(document).ready(function () {
            $("#btnShowSimple").click(function (e) {
                ShowDialog(false);
                e.preventDefault();
            });

            $("#btnShowModal").click(function (e) {
                ShowDialog(true);
                e.preventDefault();
            });

            $("#btnClose").click(function (e) {
                HideDialog();
                e.preventDefault();
            });

            $("#btnSubmit").click(function (e) {
                var brand = $("#brands input:radio:checked").val();
                $("#output").html("<b>Your favorite mobile brand: </b>" + brand);
                HideDialog();
                e.preventDefault();
            });
        });

        function ShowDialog(modal) {
            $("#overlay").show();
            $("#dialog").fadeIn(300);

            if (modal) {
                $("#overlay").unbind("click");
            }
            else {
                $("#overlay").click(function (e) {
                    HideDialog();
                });
            }
        }

        function HideDialog() {
            $("#overlay").hide();
            $("#dialog").fadeOut(300);
        } 
        
    </script>

<script type="text/javascript">
    function radiochoose(radio) {
        radio.checked = true;
        check.checked = false;
    }
</script>



    <div class="MainContent" style="background-color: #FFFFFF">
        <div align="center">
            <div style="height: auto; width: 100%; background-color: #FFFFFF;">
                <div align="center" style="height: 50px; background-color: #444444; ">
                    <asp:Label ID="Label16" runat="server" Font-Bold="True" Font-Size="XX-Large" 
                    ForeColor="White" Text="Thống Kê Doanh Thu"></asp:Label>

                  
                </div>
            </div>
        </div>
        <br />
        <div style="height: auto; padding-top: 5px;width:100%; background-color: #FFFFFF;" 
            align="center">
            <div align="right" style="float: left; width: 100%; height: auto; padding-top: 0px; background-color: #FFFFFF">
                <div align="left" style="float: right; width: 95%; height: auto; padding-top: 0px;background-color: #FFFFFF">
                    <table style="width: 95%; border-style: solid; border-width: 1px; background-color: #DDE4EC">
                        <tr>
                            <td>
                                Xem Chi Tiết Từng Tháng :<br />
                                Chọn Tháng :
                                <asp:DropDownList ID="DropDownList1" runat="server">
                                    <asp:ListItem>1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                    <asp:ListItem>3</asp:ListItem>
                                    <asp:ListItem>4</asp:ListItem>
                                    <asp:ListItem>5</asp:ListItem>
                                    <asp:ListItem>6</asp:ListItem>
                                    <asp:ListItem>7</asp:ListItem>
                                    <asp:ListItem>8</asp:ListItem>
                                    <asp:ListItem>9</asp:ListItem>
                                    <asp:ListItem>10</asp:ListItem>
                                    <asp:ListItem>11</asp:ListItem>
                                    <asp:ListItem>12</asp:ListItem>
                                </asp:DropDownList>
&nbsp; Chọn Năm :
                                <asp:DropDownList ID="DropDownList2" runat="server">
                                    <asp:ListItem>2012</asp:ListItem>
                                    <asp:ListItem>2011</asp:ListItem>
                                </asp:DropDownList>
&nbsp;&nbsp;
                                <asp:Button ID="Button1" runat="server" onclick="Button1_Click1" Text="Xem" 
                                    Width="67px" />
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                        </tr>
                    </table>
                    <table style="width: 95%">
                        <tr>
                            <td align="center" style="height: 23px; background-color: #0099FF" width="5%">
                                Tháng</td>
                            <td align="center" style="height: 23px; background-color: #0099FF" width="35%">
                                Tên Khuyến Mãi</td>
                            <td align="center" style="height: 23px; background-color: #0099FF" width="20%">
                                Đơn Giá</td>
                            <td align="center" style="height: 23px; background-color: #0099FF" width="10%">
                                Số Lượng</td>
                            <td align="center" style="height: 23px; background-color: #0099FF" width="25%">
                                Tổng Cộng </td>
                        </tr>
                        <tr>
                            <td colspan="5">
                                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                                    AutoGenerateColumns="False" ShowHeader="False" CellPadding="4" 
                                    ForeColor="#333333" GridLines="None" 
                                    onpageindexchanging="GridView1_PageIndexChanging" Width="803px">
                                    <AlternatingRowStyle BackColor="White" />
                                    <Columns>
                                        <asp:BoundField DataField="Thang">
                                        <ItemStyle Width="5%" VerticalAlign="Top" />
                                        </asp:BoundField>
                                        <asp:HyperLinkField DataNavigateUrlFields="KhuyenMai" 
                                            DataNavigateUrlFormatString="~/Products/ProductDetail.aspx?makm={0}" 
                                            DataTextField="TenKM">
                                        <ItemStyle Width="35%" />
                                        </asp:HyperLinkField>
                                        <asp:BoundField DataField="DonGiaMoi">
                                        <ItemStyle Width="20%" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="SoLuong">
                                        <ItemStyle Width="10%" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Tien">
                                        <ItemStyle Width="25%" />
                                        </asp:BoundField>
                                    </Columns>
                                    <EditRowStyle BackColor="#2461BF" />
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#EFF3FB" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" colspan="4" style="background-color: #C0C0C0" width="75%">
                                Tổng kết&nbsp;&nbsp; :&nbsp; </td>
                            <td style="background-color: #C0C0C0" width="25%">
                                <asp:Label ID="Label17" runat="server" Text="..."></asp:Label>
                            </td>
                        </tr>
                    </table>
                    <br />
                    <table style="width: 95%; border-style: solid; border-width: 1px; background-color: #DDE4EC">
                        <tr>
                            <td>
                                Xem Chi Tiết Doanh Nghiệp :<br />
                                Tên Doanh Nghiệp : &nbsp;
                                <asp:DropDownList ID="DropDownList3" runat="server">
                                </asp:DropDownList>
&nbsp;&nbsp;&nbsp; Chọn Tháng:&nbsp;
                                <asp:DropDownList ID="DropDownList4" runat="server">
                                    <asp:ListItem>1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                    <asp:ListItem>3</asp:ListItem>
                                    <asp:ListItem>4</asp:ListItem>
                                    <asp:ListItem>5</asp:ListItem>
                                    <asp:ListItem>6</asp:ListItem>
                                    <asp:ListItem>7</asp:ListItem>
                                    <asp:ListItem>8</asp:ListItem>
                                    <asp:ListItem>9</asp:ListItem>
                                    <asp:ListItem>10</asp:ListItem>
                                    <asp:ListItem>11</asp:ListItem>
                                    <asp:ListItem>12</asp:ListItem>
                                </asp:DropDownList>
&nbsp;&nbsp; Năm:
                                <asp:DropDownList ID="DropDownList5" runat="server">
                                    <asp:ListItem>2012</asp:ListItem>
                                    <asp:ListItem>2011</asp:ListItem>
                                </asp:DropDownList>
&nbsp;&nbsp;&nbsp;
                                <asp:Button ID="Button3" runat="server" onclick="Button3_Click" Text="Xem" 
                                    Width="67px" />
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                        </tr>
                    </table>
                    <table style="width: 95%">
                        <tr>
                            <td align="center" style="height: 23px; background-color: #0099FF" width="5%">
                                Tháng</td>
                            <td align="center" style="height: 23px; background-color: #0099FF" width="35%">
                                Tên Khuyến Mãi</td>
                            <td align="center" style="height: 23px; background-color: #0099FF" width="20%">
                                Đơn Giá</td>
                            <td align="center" style="height: 23px; background-color: #0099FF" width="10%">
                                Số Lượng</td>
                            <td align="center" style="height: 23px; background-color: #0099FF" width="25%">
                                Tổng Cộng </td>
                        </tr>
                        <tr>
                            <td colspan="5">
                                <asp:GridView ID="GridView2" runat="server" AllowPaging="True" 
                                    AutoGenerateColumns="False" ShowHeader="False" CellPadding="4" 
                                    ForeColor="#333333" GridLines="None" 
                                    onpageindexchanging="GridView2_PageIndexChanging" Width="803px">
                                    <AlternatingRowStyle BackColor="White" />
                                    <Columns>
                                        <asp:BoundField DataField="Thang">
                                        <ItemStyle Width="5%" VerticalAlign="Top" />
                                        </asp:BoundField>
                                        <asp:HyperLinkField DataNavigateUrlFields="KhuyenMai" 
                                            DataNavigateUrlFormatString="~/Products/ProductDetail.aspx?makm={0}" 
                                            DataTextField="TenKM">
                                        <ItemStyle Width="35%" />
                                        </asp:HyperLinkField>
                                        <asp:BoundField DataField="DonGiaMoi">
                                        <ItemStyle Width="20%" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="SoLuong">
                                        <ItemStyle Width="10%" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Tien">
                                        <ItemStyle Width="25%" />
                                        </asp:BoundField>
                                    </Columns>
                                    <EditRowStyle BackColor="#2461BF" />
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#EFF3FB" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" colspan="4" style="background-color: #C0C0C0" width="75%">
                                Tổng kết&nbsp;&nbsp; :&nbsp; </td>
                            <td style="background-color: #C0C0C0" width="25%">
                                <asp:Label ID="Label18" runat="server" Text="..."></asp:Label>
                            </td>
                        </tr>
                    </table>
                    <br />

    <input type="button" id="btnShowSimple" value="Xem Biểu Đồ Doanh Thu" />
    
    <br /><br />       
    
    <div id="output"></div>
    
    <div id="overlay" class="web_dialog_overlay"></div>
    
    <div id="dialog" class="web_dialog">
        <table style="width: 100%; border: 0px;" cellpadding="3" cellspacing="0">
            <tr>
                <td class="web_dialog_title">Doanh Thu hàng Tháng</td>
                <td class="web_dialog_title align_right">
                    <a href="#" id="btnClose">Close</a>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            
            <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2" style="padding-left: 15px;">
                    <div id="graph">
                       
                    </div>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            
        </table>
    </div>
                    <br />
                    <br />

                </div>
                 <div align="left" style="float: right; width: 95%; height: auto; padding-top: 0px;background-color: #FFFFFF">
                    <div style="height: auto">
                    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">  
                    </asp:ToolkitScriptManager>  

                    

    
    
  
                 
                    </div>
                    </div>
                
                <div align="left" style="float: right; width: 95%; height: auto; padding-top: 0px;background-color: #FFFFFF">
                    <div style="height: auto">
 <script type="text/javascript" src="../../jscharts.js"></script>                   
                <div align="right" 
                    style="float: left; width: 48%; height: auto; padding-top: 5px;">                   
                      
                       <script type="text/javascript">
                       var y=  <%= Get_Year(0) %>; 
                       
                       var myData = <%= getJson("2012") %>;
                            
                        var year="Năm "
                        year+=y+" - Đơn vị: tiền triệu";
                            var colors = ['#CE0000', '#EF2323', '#D20202', '#A70000', '#850000', '#740000', '#530000', '#850000', '#B00000', '#9C0404', '#CE0000', '#BA0000'];
                            var myChart = new JSChart('graph', 'bar');
                            myChart.setDataArray(myData);
                            myChart.colorizeBars(colors);
                            myChart.setDataArray(myData);
                            myChart.setAxisColor('#9D9F9D');
                            myChart.setAxisWidth(1);
                            myChart.setAxisNameX(year);
                            myChart.setAxisNameY('');
                            myChart.setAxisNameColor('#655D5D');
                            myChart.setAxisNameFontSize(10);
                            myChart.setAxisPaddingLeft(50);
                            myChart.setAxisValuesDecimals(1);
                            myChart.setAxisValuesColor('#9C1919');
                            myChart.setTextPaddingLeft(0);
                            myChart.setBarValuesColor('#9C1919');
                            myChart.setBarBorderWidth(0);
                            myChart.setTitleColor('#8C8382');
                            myChart.setGridColor('#5D5F5D');
                            myChart.draw();
                       
                    </script>
                        
                </div>
                <div style="float: right; width: 48%; height: auto; padding-top: 5px;">
               
                       
                        </div>
                </div>
                    
                        <br />
                    
                    </div>
                </div>
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            </div>
            
            
            <br />
            
            <br />
            
        </div>
    </div>
    <div>

    </div>
    </asp:Content>
